<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
  <div id="app">
    <el-upload action="http://localhost:3000/upload" :http-request="requestApi">
      <el-button type="primary">测试上传文件</el-button>
    </el-upload>
  </div>
</body>
  <!-- import Vue before Element -->
  <script src="https://unpkg.com/vue@2/dist/vue.js"></script>
  <!-- import JavaScript -->
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  <script src="./spark-md5.min.js"></script>
  <script type="module">
    import ajax from './ajax.js';
    new Vue({
      el: '#app',
      methods: {
        requestApi: (option) => {
            option.checkUrl = 'http://localhost:3000/check';
            option.mergeUrl = 'http://localhost:3000/merge';
            return ajax(option);
        }
      }
    })
  </script>
</html>